package nl.hu.modellingengine.menu.client;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;

import nl.hu.modellingengine.client.ClientFactory;
import nl.hu.modellingengine.menu.client.activity.MenuActivityMapper;

public class Menu {
	
	private SimplePanel appWidget = new SimplePanel();
	
	public Menu(RootPanel containerPanel,ClientFactory clientFactory){
		EventBus eventBus = clientFactory.getEventBus();
		MenuFactory menuFactory = GWT.create(MenuFactory.class);
		
		  // Start ActivityManager for the main widget with our ActivityMapper
        ActivityMapper activityMapper = new MenuActivityMapper(clientFactory,menuFactory);
        ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
        activityManager.setDisplay(appWidget);
        containerPanel.add(appWidget);
	}

}
